import 'package:find_friend/const/const.dart';
import 'package:flutter/material.dart';

class ThemeChanger with ChangeNotifier {

  ThemeData _themeData;
  final _lightTheme = ThemeData.light().copyWith(
    splashColor: Colors.transparent,
    highlightColor: Colors.transparent,
    scaffoldBackgroundColor: Colors.white,
    primaryColor: APP_main_color,
    primaryIconTheme: IconThemeData(color: Colors.black),
    primaryTextTheme: TextTheme(headline6: TextStyle(color: Colors.black,fontSize: 17,fontWeight: FontWeight.normal)),
    appBarTheme: AppBarTheme(elevation: 0.5, brightness: Brightness.light),
  );
  final _darkTheme = ThemeData.dark().copyWith(
    splashColor: Colors.transparent,
    highlightColor: Colors.transparent,
    appBarTheme: AppBarTheme(elevation: 1, brightness: Brightness.light),
    scaffoldBackgroundColor: const Color(0xfff9f9f9),
  );

  ThemeData getTheme() =>  _themeData ?? _lightTheme;

  void switchTheme() {
    if(_themeData == _lightTheme) {
      _themeData = _darkTheme;
    } else {
      _themeData = _lightTheme;
    }

    notifyListeners();
  }
}